﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace BrokerBase.Lib.Product
{
    public abstract class AbstractProductExpander:IProductExpander
    {
        public virtual void Loaded(IPolicy policy)
        {
            policy.MaxInsuranceAge = policy.MaxInsuranceAge == 0 ? 100 : policy.MaxInsuranceAge;
        }

        public void Loaded(IPolicy policy, NHibernate.ISession session)
        {
            policy.MaxInsuranceAge = policy.MaxInsuranceAge == 0 ? 100 : policy.MaxInsuranceAge;
        }

        public virtual bool InitPolicy(IPolicy policy, out string msg)
        {
            msg = null;
            return true;
        }
        /// <summary>
        /// 保单指向的目标
        /// 默认等于被保人
        /// </summary>
        public virtual PolicyTarget Target
        {
            get { return PolicyTarget.Insurant; }
        }
        /// <summary>
        /// 输入金额是否允许小数
        /// </summary>
        public virtual bool IsDecimal
        {
            get { return true; }
        }


        
    }
}
